package kr.priv.contest;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

public class AT_main extends Activity {

	private Intent intent;
	

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		Button btn_recommend = (Button) findViewById(R.id.btn_recommend);
		btn_recommend.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(AT_main.this,
						AT_recommend.class);
				startActivity(intent);
			}
		});

		Button btn_registration = (Button) findViewById(R.id.btn_registration);
		btn_registration.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(AT_main.this,
						AT_registration.class);
				startActivity(intent);
			}
		});

		Button btn_collection = (Button) findViewById(R.id.btn_collection);
		btn_collection.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(AT_main.this,
						AT_collection.class);
				startActivity(intent);
			}
		});

		Button btn_network = (Button) findViewById(R.id.btn_network);
		btn_network.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(AT_main.this,
						AT_network.class);
				startActivity(intent);
			}
		});

	}

	
	//  outter_menu
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// TODO Auto-generated method stub
		
		super.onCreateOptionsMenu(menu);
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.menu, menu);

		return true;

	}

	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {

		case R.id.setting_menu:

			intent = new Intent(AT_main.this, AT_setting.class);
			startActivity(intent);

			break;

		case R.id.help_menu:

			intent = new Intent(AT_main.this, AT_help.class);
			startActivity(intent);

			break;
		}

		return false;
	}
}
